#ifndef FILEINFOAREA_H
#define FILEINFOAREA_H

#include <QWidget>
#include <QLabel>
#include <QTextEdit>
#include <QResizeEvent>
#include "FileInfo.h"
#include <QPixmap>
#include <QScrollArea>
#include <QTimer>

class FileInfoArea : public QWidget
{
    Q_OBJECT

public:
    explicit FileInfoArea(QWidget *parent = nullptr);

public slots:
    void displayFileInfo(const FileInfo& fileInfo);

protected:
    void resizeEvent(QResizeEvent *event) override;

private:
    void setupUI();
    void updateImageSize();
    void delayedResize();

    QLabel *m_imageLabel;
    QTextEdit *m_infoTextEdit;
    QPixmap m_currentPixmap;
    QScrollArea *m_scrollArea;
    QTimer *m_resizeTimer;
};

#endif // FILEINFOAREA_H
